Backstage Pagerduty Plugin 404

Hi,

I follow Pagerduty Backstage Plugin installation via https://pagerduty.github.io/backstage-plugin-docs/getting-started/backstage/ but I am getting all the time: {“error”:{“message”:“Not Found”,“code”:2100},“suggestion”:“When using api.pagerduty.com, the /api/ prefix is not required.”}. Would like to know what that means …

Also get the following: ::ffff:10.0.X.X - - [20/Jan/2024:09:57:39 +0000] “GET /api/proxy/pagerduty/services?include%5B%5D=integrations&include%5B%5D=escalation_policies&query=XXXXXXXXXXX&time_zone=UTC HTTP/1.1” 404 124 “-” “Amazon CloudFront”

So seems can not make the plugin work ad only get this:

Hello @joaquin.henriquez.alzola!

My name is Tiago and I’m the maintainer of the PagerDuty plugin. On a first look, this seems like a misconfiguration on the service side.

Could you please double-check that the serviceId specified in your entity yaml file is correct? You should have a file with one or more entities that should look something like this:

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: Catalog
  annotations:
    pagerduty.com/integration-key: [YOUR-INTEGRATION-KEY]
    pagerduty.com/service-id: [YOUR-SERVICE-ID]
spec:
  type: website
  lifecycle: experimental
  owner: guests
  system: SwagStore
  providesApis: [catalog-api]

Let me know if this helps. Feel free to send a Direct Message as well so we can troubleshoot the issue if this doesn’t put you in the right direction.

Hi Tiago,

All sorted now. I had to modify on the app-config.yaml the Pagerduty Proxy path rewrite to redirect to the correct place. Needed to put backstage in debug mode to see the path it was originally trying to hit.

So all solved now.

Thanks

1 Like

Glad that it is working now. Be on the lookout for the next release of the plugin that should take place later this week.

I’m working on moving all REST API calls to the backend plugin for additional security and performance optimization. This will replace the usage of the proxy and the proxy configuration in app-config.yaml will not longer be required. If you want to be notified watch the repo to subscribe for changes.

  • Is this correct in your config docs? The todo() should not be pagerduty()?
  apiRouter.use('/pagerduty', await todo(pagerdutyEnv));

From: https://pagerduty.github.io/backstage-plugin-docs/getting-started/backstage/

yarn add --cwd packages/app @pagerduty/backstage-plugin-commmon
1 Like

FYI also can not deploy to my K8s cluster the backstage after updating PD plugin to 0.8.1 & 0.0.1 and for the backend 0.3.1 & 0.0.1. The readiness/liveness is failing.

bellow part of the log exception:

/backend/packages/backend/node_modules/@pagerduty/backstage-plugin-common/dist/index.esm.js:18
export { HttpError, PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID };
SyntaxError: Unexpected token 'export'
^^^^^^
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1274:20)
...
at Object.<anonymous> (/backend/packages/backend/node_modules/@pagerduty/backstage-plugin-backend/dist/index.cjs.js:8:29)
...

There must be a bug in your code …

Thanks for reporting these @joaquin.henriquez.alzola.

I have fixed the typos on the docs and you should see them fixed soon. Let me try to replicate the issue you are having while running the plugins in Kubernetes. Can you please share your readiness/liveness configuration?

          livenessProbe:
            failureThreshold: 10
            httpGet:
              path: /healthcheck
              port: 7007
              scheme: HTTP
            initialDelaySeconds: 30
            periodSeconds: 5
            successThreshold: 1
            timeoutSeconds: 5
          readinessProbe:
            failureThreshold: 2
            httpGet:
              path: /healthcheck
              port: 7007
              scheme: HTTP
            initialDelaySeconds: 30
            periodSeconds: 10
            successThreshold: 2
            timeoutSeconds: 5

Healthcheck endpoint is taken from backstage directly.

Error I had in k8s (added in previous thread the exception I am getting from export)

Liveness probe failed: Get "[http://10.0.x.x:7007/healthcheck"](http://10.0.x.x:7007/healthcheck%22): context deadline exceeded (Client.Timeout exceeded while awaiting headers)
Readiness probe failed: Get "[http://10.0.x.x:7007/healthcheck"](http://10.0.x.x:7007/healthcheck%22): context deadline exceeded (Client.Timeout exceeded while awaiting headers)

Thanks for the help @joaquin.henriquez.alzola! This issue is now solved and released on the latest version.